package com.example.ovulationperiodtracker.Allactivity;

import android.content.Intent;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.ovulationperiodtracker.databinding.ActivityNotificationsBinding;
import com.example.ovulationperiodtracker.pill_reminder.Pill_MainActivity;
import com.example.ovulationperiodtracker.utils.JCGSQLiteHelper;
import com.example.ovulationperiodtracker.periodadepter.NotificationAdapter;
import com.example.ovulationperiodtracker.R;
import com.example.ovulationperiodtracker.model.Settings;
import com.necer.base.BaseActivity;

public class NotificationsActivity extends BaseActivity<ActivityNotificationsBinding> {


    @Override
    protected ActivityNotificationsBinding createBinding(LayoutInflater inflater) {
        return ActivityNotificationsBinding.inflate(inflater);
    }

    @Override
    protected void onCreated(Bundle savedInstanceState) {
        ListView notificationItems = (ListView) findViewById(R.id.listDefNotifications);
        notificationItems.setSelector(new ColorDrawable(Color.TRANSPARENT));
        notificationItems.setAdapter(new NotificationAdapter(this));
        notificationItems.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
                Intent openDetails = new Intent(NotificationsActivity.this, NotificationDActivity.class);
                openDetails.putExtra("position", String.valueOf(position));
                startActivity(openDetails);
            }
        });
    }

}
